package com.lw.nacos.client.controller;

import com.lw.nacos.client.feign.NacosServerFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
@RestController
@RequestMapping("/clients")
public class UserClientController {
    @Autowired
    RestTemplate restTemplate;
    /*@Autowired
    NacosServerFeign nacosServerFeign;*/
    @PostMapping ("/{username}")
    public String getInfoByUsername(@PathVariable String username){
        System.out.println(username);
       return  restTemplate.getForObject("http://NacosProvider/provider",String.class);
      /* return  nacosServerFeign.getInfoByUsername(username);*/
    }
    @GetMapping
    public String test(){
        return "hello";
    }
   /* @GetMapping("/test2")
    public String test2(){
        return restTemplate.getForObject("http://localhost:9003/provider",String.class);
    }*/


}
